package com.Home
{
	import com.*;
	import com.Engine.*;
	import com.Packet.*;
	import com.UI.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.external.*;
	import flash.filters.*;
	import flash.geom.*;
	import flash.system.*;
	import flash.text.*;
	import flash.ui.*;
	import flash.utils.*;
	
	import org.aswing.*;
	import org.aswing.border.*;
	import org.aswing.border.EmptyBorder;
	import org.aswing.colorchooser.*;
	import org.aswing.dnd.*;
	import org.aswing.event.*;
	import org.aswing.ext.*;
	import org.aswing.geom.*;
	import org.aswing.tree.AbstractLayoutCache;
	public class FrameHomeBuilding7Main extends FrameHomeBuilding
	{
		private var btn_double:JButton;
		private var btn_accompany:JButton;
		public function FrameHomeBuilding7Main()
		{
			btn_double = new JButton();
			btn_double.setSize(new IntDimension(72, 23));
			btn_double.setPreferredSize(new IntDimension(72, 23));
			btn_double.setText("元神双修");
			
			btn_accompany = new JButton();
			btn_accompany.setSize(new IntDimension(72, 23));
			btn_accompany.setPreferredSize(new IntDimension(72, 23));
			btn_accompany.setText("元神陪练");
			
			panelButtons.append(btn_double);
			panelButtons.append(btn_accompany);
			
			btn_double.wrapSimpleButton(Client.getUIElement("btn_4") as SimpleButton);
			btn_accompany.wrapSimpleButton(Client.getUIElement("btn_4") as SimpleButton);
			
			var filter:GlowFilter;
			var font:ASFont = new ASFont("宋体", 14, false, false, false, false);
			filter = new GlowFilter(0x000000, 1, 2, 2, 5);
			btn_double.setFont(font);
			btn_double.setForeground(ASColor.WHITE);
			btn_double.setTextFilters(new Array(filter));
			
			btn_accompany.setFont(font);
			btn_accompany.setForeground(ASColor.WHITE);
			btn_accompany.setTextFilters(new Array(filter));
			
			btn_double.addActionListener(function():void{FrameLover.show();});
			btn_accompany.addActionListener(function():void{FrameSlave.show();});
		}
		override public function setImages():void
		{
			super.setImages();
			var img_char_background:DisplayObject = Client.getUIElement("img_home_bg_7") as DisplayObject
			setBackgroundDecorator(new AssetBackground(img_char_background));
			setSize(new IntDimension(img_char_background.width, img_char_background.height));
			setPreferredSize(new IntDimension(img_char_background.width, img_char_background.height));
			setSizeWH(img_char_background.width,img_char_background.height);
			setLocationXY((Engine.W - img_char_background.width) / 2,(Engine.H - img_char_background.height)/2);
			btn_dispatch.addActionListener(function():void{FrameHomeDispatch.show(objDest,_frame);});
			btn_accelerate.addActionListener(function():void{FrameHomeAccelerate.show(_frame);});
		}
		public static var _frame:FrameHomeBuilding7Main = null;
		public static function show(obj:ObjectHomeBuilding):void
		{
			if(_frame == null)
			{
				_frame = new FrameHomeBuilding7Main();
				PanelMainHelp.getInstance().addChild(_frame);
			}
			if(!isShowing())
			{
				_frame.show();
				_frame.setLocationXY((Engine.W - _frame.width) / 2,(Engine.H - _frame.height)/2);
				PanelMainHelp.getInstance().bringToTop(_frame);
			}
			_frame.update(obj);
			
		}
		public static function hide():void
		{
			if(isShowing())_frame.hide();
		}
		public static function isShowing():Boolean
		{
			return(_frame != null&& _frame.isShowing());
		}
	}
}